package org.br.erp.base.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.br.erp.base.entity.Scmuom;
import org.br.erp.base.mapper.ScmuomMapper;
import org.br.erp.base.service.IScmuomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

/**
 * @Description: 计量单位定义
 * @Author: jeecg-boot
 * @Date:   2022-08-20
 * @Version: V1.0
 */
@Service
public class ScmuomServiceImpl extends ServiceImpl<ScmuomMapper, Scmuom> implements IScmuomService {

    @Autowired
    private ScmuomMapper scmuomMapper;
    @Override
    public Scmuom getScmUomByUomName(String uomname) {
        QueryWrapper<Scmuom> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("uomname",uomname);
        List<Scmuom> scmuoms = scmuomMapper.selectList(queryWrapper);
        if(scmuoms.size()>0){
            return scmuoms.get(0);
        }else{
            return null;
        }
    }
}
